package cn.doit.scala.day06

/**
 * @DATE 2021/12/31/9:23
 * @Author MDK
 * @Version 2021.2.2
 * */
case class User(id:Int, name:String, age:Int)/*extends Ordered[User]{
  override def compare(that: User): Int = {
    this.age-that.age
  }
}*/
object User{
  def main(args: Array[String]): Unit = {
    val user = new User(1, "zss", 23)
    //case class类中的属性变量默认全局变量
    // class类中的属性变量如果没有var或者val修饰是局部变量
    user.id
    user.name
  }
}